<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/29
 * Time: 16:39
 */

namespace app\admin\model;


class ExclusiveGive extends DataBase
{
    protected $name = 'Exclusive_give';
    protected $autoWriteTimestamp = true;

    public function themeExclusiveDetail()
    {
        $exclusive_theme_id = input('get.exclusive_theme_id');
        $data = $this->where('exclusive_theme_id','=',$exclusive_theme_id)->field('use_user_id')->select()->toArray();

        foreach($data as $key=> $value){
            $userInfo = User::field('id,u_id,nickname')->where('id','=',$value['use_user_id'])->find();
            $data[$key]['user_id'] = $userInfo['id'];
            $data[$key]['u_id'] = $userInfo['u_id'];
            $data[$key]['nickname'] = $userInfo['nickname'];
        }
        return $data;
    }
}